/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "GCM")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Gcm.findAll", query = "SELECT g FROM Gcm g"),
    @NamedQuery(name = "Gcm.findByGcmID", query = "SELECT g FROM Gcm g WHERE g.gcmID = :gcmID"),
    @NamedQuery(name = "Gcm.findByRegid", query = "SELECT g FROM Gcm g WHERE g.regid = :regid")})
public class Gcm implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "gcmID")
    private Integer gcmID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "regid")
    private String regid;

    public Gcm() {
    }

    public Gcm(Integer gcmID) {
        this.gcmID = gcmID;
    }

    public Gcm(Integer gcmID, String regid) {
        this.gcmID = gcmID;
        this.regid = regid;
    }

    public Integer getGcmID() {
        return gcmID;
    }

    public void setGcmID(Integer gcmID) {
        this.gcmID = gcmID;
    }

    public String getRegid() {
        return regid;
    }

    public void setRegid(String regid) {
        this.regid = regid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (gcmID != null ? gcmID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Gcm)) {
            return false;
        }
        Gcm other = (Gcm) object;
        if ((this.gcmID == null && other.gcmID != null) || (this.gcmID != null && !this.gcmID.equals(other.gcmID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.Gcm[ gcmID=" + gcmID + " ]";
    }
    
}
